* {
    margin: 0;
    padding: 0;
}
body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.wrapper {
    width: 60vw;
    height: 60px;
    line-height: 60px;
    background-color: #fff;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.25);
    border-radius: 50px;

    nav {
        display: flex;
        position: relative;
        #home:checked ~ label.home a,
        #comment:checked ~ label.comment a,
        #envelope:checked ~ label.envelope a,
        #heart:checked ~ label.heart a,
        #user:checked ~ label.user a {
            color: #fff;
            transition: 0.6s;
        }
        #comment:checked ~ .tab {
            left: 20%;
        }
        #envelope:checked ~ .tab {
            left: 40%;
        }
        #heart:checked ~ .tab {
            left: 60%;
        }
        #user:checked ~ .tab {
            left: 80%;
        }
        input {
            display: none;
        }
        label {
            flex: 1;
            width: 100%;
            position: relative;
            z-index: 1;
            cursor: pointer;
            a {
                position: relative;
                z-index: -1;
                color: #333;
                font-size: 20px;
                font-weight: 500;
                text-decoration: none;
                i {
                    font-size: 25px;
                    margin: 0 7px;
                }
            }
        }
        .tab {
            position: absolute;
            height: 100%;
            width: 20%;
            left: 0px;
            bottom: 0px;
            background: linear-gradient(to right, #f09819, #ff5858);
            border-radius: 50px;
            transition: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }
    }
}
